package com.heima.model.behavior.pojos;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * @Author XHui
 * @Since 2024/2/22 12:17
 * @Version 1.0
 */
@Data
@Document("ap_likes_behavior")
public class ApLikesBehavior {

    /**
     * 编号
     */
    @Id
    private String id;

    /**
     * 条目 ID
     */
    private String entryId;

    /**
     * 文章ID：
     */
    private Long articleId;

    /**
     * 点赞内容类型
     * 0: 文章
     * 1: 动态
     */
    private Short type;

    /**
     * 操作
     * 0: 点赞
     *  1: 取消点赞
     */
    private Short operation;

    /**
     * 创建时间
     */
    private LocalDateTime createdTime;

    public enum Type {
        ARTICLE((short) 0),
        DYNAMIC((short) 1);
        private final short value;
        Type(short value) {
            this.value = value;
        }
        public short getValue() {
            return value;
        }
    }

    public enum Operation {
        LIKE((short) 0),
        UNLIKE((short) 1);

        private final short value;

        Operation(short value) {
            this.value = value;
        }

        public short getValue() {
            return value;
        }

    }

}
